package com.we.flink.userlabelplatform.table;

import java.sql.Timestamp;

public class TableSuperMemberRecord {
    public static final String KFKTABLE = "fdm.hhl01_super_member_record";
    public static final String QUERYSQL =
            "select id, uid, member_type, status, "
                    + "cast(if(auto_renew is null, 0, auto_renew) as tinyint) auto_renew,"
                    + "if(update_time is null, TIMESTAMP '1970-01-01 08:00:00.000000', update_time) as update_time,"
                    + "if(delete_time is null, TIMESTAMP '1970-01-01 08:00:00.000000', delete_time) as delete_time "
                    + "from "
                    + KFKTABLE;

    public long id;
    public long uid;
    public byte member_type;
    public byte auto_renew;
    public byte status;
    public Timestamp update_time;
    public Timestamp delete_time;

    public TableSuperMemberRecord() {}

    public TableSuperMemberRecord(
            long id,
            long uid,
            byte member_type,
            byte auto_renew,
            byte status,
            Timestamp update_time,
            Timestamp delete_time) {
        this.id = id;
        this.uid = uid;
        this.member_type = member_type;
        this.auto_renew = auto_renew;
        this.status = status;
        this.update_time = update_time;
        this.delete_time = delete_time;
    }

    public long getId() {
        return id;
    }

    public long getUid() {
        return uid;
    }

    public byte getMember_type() {
        return member_type;
    }

    public byte getAuto_renew() {
        return auto_renew;
    }

    public byte getStatus() {
        return status;
    }

    public Timestamp getUpdate_time() {
        return update_time;
    }

    public Timestamp getDelete_time() {
        return delete_time;
    }

    @Override
    public String toString() {
        return "TableSuperMemberRecord{"
                + "id="
                + id
                + ", uid="
                + uid
                + ", member_type="
                + member_type
                + ", auto_renew="
                + auto_renew
                + ", status="
                + status
                + ", update_time="
                + update_time
                + ", delete_time="
                + delete_time
                + '}';
    }
}
